package momo.multitree.structure;

import junit.framework.TestCase;


public class EdgeTest extends TestCase {
	
	private Edge edge;
	private Node node1;
	private Node node2;
	private double cost12;
	private double cost21;
	private double lat12;
	private double lat21;

	protected void setUp() throws Exception {
		super.setUp();
		node1 = new Node("1", 1, 1);
		node2 = new Node("2", 1, 1);
		cost12 = 20;
		cost21 = 10;
		lat12 = 15;
		lat21 = 30;
		edge = new Edge("1", node1, node2, cost12, cost21, lat12, lat21);
	}

	protected void tearDown() throws Exception {
		super.tearDown();
	}

	public void testNextNode() {
		assertEquals(node2, edge.nextNode(node1));
	}

	public void testGetHeadNode() {
		assertEquals(node1, edge.getHeadNode());
	}

	public void testGetTailNode() {
		assertEquals(node2, edge.getTailNode());
	}

	public void testGetCost() {
		assertEquals(cost12, edge.getCost(node1));
		assertEquals(cost21, edge.getCost(node2));
	}

	public void testGetLatency() {
		assertEquals(lat12, edge.getLatency(node1));
		assertEquals(lat21, edge.getLatency(node2));
	}

}
